#!/bin/sh
mpiCase (){
    cp -r damBreak4phaseFine damBreak4phaseFine$1 \
        >> /dev/null
    sed -i '18cnumberOfSubdomains '$1';' \
        damBreak4phaseFine$1/system/decomposeParDict
    sed -i 's/2/'$1'/g' \
        damBreak4phaseFine$1/Allsbatch
    sed -i 's/damBreak4phaseFine/damBreak4phaseFine'$1'/g' \
       damBreak4phaseFine$1/Allsbatch
#    sbatch ./damBreak4phaseFine$1/Allsbatch
}
serialCase (){
    cp -r damBreak4phaseFine damBreak4phaseFine1 \
        >> /dev/null
    rm damBreak4phaseFine1/system/decomposeParDict
    sed -i '15cmultiphaseEulerFoam' \
        damBreak4phaseFine1/Allsbatch
    sed -i 's/damBreak4phaseFine/damBreak4phaseFine1/' \
        damBreak4phaseFine1/Allsbatch
    sed -i '14d' \
        damBreak4phaseFine1/Allsbatch
    sed -i '3d' \
        damBreak4phaseFine1/Allsbatch
#    sbatch ./damBreak4phaseFine1/Allsbatch
}
mpiCase 16
serialCase
#------------------------------------------------------------------------------
